/*********************************************************************************
 *Author:       OnClick
 *Version:      1.0
 *UnityVersion: 2017.2.3p3
 *Date:         2019-01-26
 *Description:   
 *History:  
**********************************************************************************/
namespace IFramework
{
    public class Xml
    {
        private static IXmlHelper helper;
        public static void SetHelper(IXmlHelper helper)
        {
            Xml.helper = helper;
        }
        private static void CheckNull()
        {
            if (helper==null)
            {
                SetHelper(new DefaultXmlHelper());
            }
        }
        public static string ToXmlString<T>(T t)
        {
            CheckNull();
            return helper.ToXmlString(t);
        }
        public static T ToObject<T>(string xmlString)
        {
            CheckNull();
            return helper.ToObject<T>(xmlString);
        }
    }
}